home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1833 / 1833.xpi / chrome / m / yoono.com / sidebar.jar / sidebar / js / yloader.js < prev    next >
Text File  |  2009-12-16  |  2KB  |  1 lines

  1. var YoonoLoader={isIE:!!(window.attachEvent),yoonoApiModules:["yoono.lang","yoono.dom","yoono.event","yoono.localization"],scripts:["yoodget.js"],lastScripts:["./js/yoodget.js","./js/locales.js"],cptrScriptsLoaded:0,css:["skins.css","yoodget.css","./css/yoodget.css"],cptrCssLoaded:0,path:".",initMethodName:"",requireJs:function(a,b){var c=document.createElement("script");c.setAttribute("type","text/javascript");if(!this.isIE){c.onload=function(){YoonoLoader.cptrScriptsLoaded++;YoonoLoader.checkAllLoaded()}}else{c.onreadystatechange=function(){if(this.readyState=="complete"){setTimeout(function(){YoonoLoader.cptrScriptsLoaded++;YoonoLoader.checkAllLoaded()},0)}}}if("."==a.substr(0,1)){c.src=a.substr(2)}else{c.src=YoonoLoader.path+"js/"+a}b.appendChild(c)},requireCss:function(c,a){var b=document.createElement("link");b.onload=function(){YoonoLoader.cptrCssLoaded++;YoonoLoader.checkAllLoaded()};b.setAttribute("type","text/css");b.setAttribute("rel","stylesheet");if("."==c.substr(0,1)){b.href=c.substr(2)}else{b.href=YoonoLoader.path+"css/"+c}a.appendChild(b)},load:function(h,f,d,g,c,e){yoono.require(this.yoonoApiModules);this.initMethodName=g;var h=h.substr(0,h.lastIndexOf("/"));this.path=h.substr(0,h.lastIndexOf("/")+1);if(""!=d){var k=d.split(",");for(var b=0;b<k.length;b++){this.scripts.push("yoono/YoonoAPI/thirdpart/scriptaculous/"+k[b]+".js")}}if(c){for(var b=0;b<c.length;b++){this.scripts.push(c[b])}}for(var a=0;a<this.lastScripts.length;a++){this.scripts.push(this.lastScripts[a])}for(var a=0;a<this.scripts.length;a++){this.requireJs(this.scripts[a],f)}for(var a=0;a<this.css.length;a++){this.requireCss(this.css[a],f)}if(e){for(var b=0;b<e.length;b++){this.requireCss(e[b],f)}}},checkAllLoaded:function(){if(this.cptrScriptsLoaded==this.scripts.length){if(this.initMethodName in window){try{window[this.initMethodName]()}catch(a){var b="Error in yoodget ";if(window.yoodget&&window.yoodget.yuid){b+=window.yoodget.yuid+" "}b+=": removing.";alert("YoonoLoader.checkAllLoaded:"+b);YServices.log.exception(a);window.ynWrapper.close()}}}}};